Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for npm overrides #850

Merged
merged 2 commits into from
Mar 23, 2023
Merged

Conversation

mansona
Copy link
Member

@mansona mansona commented May 13, 2022

This PR is supposed to help with the issue that is described in emberjs/ember-render-modifiers#64

Essentially npm thinks that ranges shouldn't be satisfied if you are using pre-releases. You can overcome this if you use an overrides in npm which works in a very similar way to yarn resolutions.

The issue is that if you provide an overrides config to ember-try it will just ignore it:

{
  name: 'ember-release',
  npm: {
    devDependencies: {
      'ember-source': await getChannelURL('release'),
    },
    overrides: {
      'ember-source': '$ember-source',
    },
  },
},

This PR implements npm overrides in much the same way as yarn resolutions 👍 in fact I copy and pasted all of the resolutions tests and just changed resolutions to overrides in most cases 😂

@codecov
Copy link

codecov bot commented May 13, 2022

Codecov Report

Merging #850 (d92f586) into master (4540780) will increase coverage by 0.01%.
The diff coverage is 100.00%.

❗ Current head d92f586 differs from pull request most recent head 7a2d4e9. Consider uploading reports for the commit 7a2d4e9 to get more accurate results

@@            Coverage Diff             @@
##           master     #850      +/-   ##
==========================================
+ Coverage   94.36%   94.37%   +0.01%     
==========================================
  Files          17       17              
  Lines         550      551       +1     
==========================================
+ Hits          519      520       +1     
  Misses         31       31              
Impacted Files Coverage Δ
lib/dependency-manager-adapters/npm.js 98.34% <100.00%> (+0.01%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@kategengler
Copy link
Member

Thanks! Can you also add something to the readme about this feature?

@mansona
Copy link
Member Author

mansona commented May 13, 2022

@kategengler yes that would make a lot of sense if I did that 😂 I'm working on this live on my stream so I guess I just overlooked it 🙃

I've added them now 👍

ctjhoa pushed a commit to concordnow/ember-content-loader that referenced this pull request Jun 6, 2022
malgasm added a commit to dictatelife/ember-cli-dompurify that referenced this pull request Sep 11, 2022
@kategengler kategengler merged commit 81c6107 into ember-cli:master Mar 23, 2023
@kategengler
Copy link
Member

Thank you!

@mansona mansona deleted the npm-overrides branch March 25, 2023 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants